package org.jeecg.modules.third.nucarf.dto;

import java.io.Serializable;

public class NucartResult<T> implements Serializable {
	private static final long serialVersionUID = 1L;
	private String message;
	private String code;
	private String outstandingBalance;



	private T result;

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public T getResult() {
		return result;
	}

	public void setResult(T result) {
		this.result = result;
	}

	public String getOutstandingBalance() {
		return outstandingBalance;
	}

	public void setOutstandingBalance(String outstandingBalance) {
		this.outstandingBalance = outstandingBalance;
	}

	public Boolean isSuccess() {
		return "0".equals(this.code);
	}

	public static NucartResult<?> error(String message){
		NucartResult r = new NucartResult();
		r.setCode("1");
		r.setMessage(message);
		r.setResult(null);
		return r;
	}

	@Override
	public String toString() {
		return "NucartResult{" +
				"message='" + message + '\'' +
				", code='" + code + '\'' +
				", outstandingBalance='" + outstandingBalance + '\'' +
				", result=" + result +
				'}';
	}
}